import React from 'react';
import { Tag } from 'antd';

const StatusTag = ({ status, type = 'status' }) => {
  const getStatusConfig = () => {
    if (type === 'status') {
      const statusMap = {
        upcoming: { color: 'blue', text: '即将开始' },
        completed: { color: 'green', text: '已完成' },
        cancelled: { color: 'red', text: '已取消' },
        active: { color: 'green', text: '活跃' },
        inactive: { color: 'red', text: '非活跃' },
      };
      return statusMap[status] || { color: 'default', text: '未知' };
    }
    
    if (type === 'difficulty') {
      const difficultyMap = {
        '简单': { color: 'green', text: '简单' },
        '中等': { color: 'orange', text: '中等' },
        '困难': { color: 'red', text: '困难' },
      };
      return difficultyMap[status] || { color: 'default', text: status };
    }
    
    return { color: 'default', text: status };
  };

  const config = getStatusConfig();
  return <Tag color={config.color}>{config.text}</Tag>;
};

export default StatusTag; 